import { Pipe, PipeTransform } from '@angular/core'

@Pipe({
  name: 'commentScore'
})
export class CommentScorePipe implements PipeTransform {
  transform(score) {
    if (score > 4) {
      return '好评'
    } else if (score > 1) {
      return '中评'
    } else if (score > 0) {
      return '差评'
    } else {
      return '暂未评价'
    }
  }
}
